<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=7"/>
    <link href="${pageContext.request.contextPath }/css/main.css" rel="stylesheet" type="text/css" media="all"/>
    <script src="${pageContext.request.contextPath }/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script>
        $(function () {
            $("#saveBtn").click(function () {
                let time = document.getElementById("partsprodate").value;
                time = time.replace("T", " ") + ":00";
                // document.getElementById("partsprodate").set;
                console.log(document.getElementById("partsprodate").value);
                coursesCreat.action = "${pageContext.request.contextPath}/parts/update";
                coursesCreat.submit();

            });

        })
    </script>
</head>

<body class="content-pages-body">
<div class="content-pages-wrap">
    <div class="commonTitle">
        <h2>&gt;&gt; 修改配件</h2>
    </div>
    <form id="coursesCreat" name="coursesCreat" action="" method="post">
        <input type="hidden" name="partsid" value="${parts.partsid}">
        <table border="0" cellspacing="1" cellpadding="0" class="commonTable">
            <tr>
                <td width="10%" align="right" class="title"><span class="required">*</span>配件名称：</td>
                <td width="15%" align="left"><input name="partsname" type="text" style="height:20px"
                                                    value="${parts.partsname}"></td>
                <td width="10%" align="right" class="title"><span class="required">*</span>规格型号：</td>
                <td width="15%" align="left"><input name="partsmodel" type="text" style="height:20px"
                                                    value="${parts.partsmodel}"></td>
            </tr>
            <tr>
                <td width="10%" align="right" class="title"><span class="required">*</span>生产厂家：</td>
                <td width="15%" align="left"><input name="partsloc" type="text" style="height:20px"
                                                    value="${parts.partsloc}"></td>
                <td width="10%" align="right" class="title"><span class="required">*</span>生产日期：</td>
                <td width="15%" align="left">
                    <%--                    <input name="partsprodate" type="text" style="height:20px" value="${parts.partsprodate}"></td>--%>
                    <input type="date" name="partsprodate" id="partsprodate"
                           value="<fmt:formatDate value="${parts.partsprodate}" pattern="yyyy-MM-dd" />">

            </tr>
            <tr>
                <td width="10%" align="right" class="title"><span class="required">*</span>备注：</td>
                <td width="15%" align="left" colspan="3"><textarea name="partsremark"
                                                                   style="width:720px;height:100px">${parts.partsremark}</textarea>
                </td>
            </tr>
        </table>
    </form>
</div>
<div id="formPageButton">
    <ul>
        <li><a href="#" id="saveBtn" title="保存" class="btnShort">保存</a></li>
        <li><a href="javascript:window.history.go(-1)" title="返回" class="btnShort">返回</a></li>
    </ul>
</div>

</div>

</body>
</html>
